#!/usr/bin/env php
<?php

# A client that sends a background job for email.

$begin = gettimeofday(true);

$client = new GearmanClient();
$client->addServer('127.0.0.1', 4730);
$options = array(
  'to' => 'eday@oddments.org',
  'subject' => 'Gearman Async test',
  'body' => 'This is a test email from the Gearman Cookbook'
);
$result = $client->doBackground('send_email',
                                json_encode($options));

printf("Job ran in %.6f seconds.\n",
       gettimeofday(true) - $begin);

?>
